package rgs.sphere.jdbc.algorithm;

import org.apache.shardingsphere.api.sharding.standard.RangeShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.RangeShardingValue;

import java.util.Arrays;
import java.util.Collection;

/**
 * @program: rgs-study0project
 * @description: 数据库范围查询分片策略
 * @author: Mr.Ren
 * @create: 2023-11-12 21:19
 **/
public class MyDBRangeAlgorithm implements RangeShardingAlgorithm<Long> {
    @Override
    public Collection<String> doSharding(Collection<String> collection, RangeShardingValue<Long> rangeShardingValue) {
        //将两个数据库
        return Arrays.asList("m1","m2");
    }
}
